phy_mass

Returns the mass of the instance.

语法:

phy_mass;


返回: Real(实数)


描述

This read-only variable returns the mass of the instance in kilograms. This value is calculated automatically based on the surface area of the assigned fixtures and their density values, but it can be changed using the function physics_mass_properties.


例如:

if phy_mass < other.phy_mass
   {
   instance_destroy(); // 销毁实例
   }

The above code is from the collision event of the instance with another and it compares the mass of each instance and destroys that which has less mass.


上一页: Physics Variables
next: phy_sleeping
© Copyright YoYo Games Ltd. 2018 All Rights Reserved